feat(camera): camera-handoff blend prototype (cam_blend)#350
Draft
noctonca wants to merge 2 commits into
Draft
Conversation
Deep-think on smoothing the hard cuts between camera controllers (dynamic follow, scripted zone cameras, cutscenes, manual recenter, scene transitions) and on a free dynamic camera. Covers the controller taxonomy, a blend layer that interpolates the presented camera params on a handoff, the weight-blend needed for a moving (dynamic) target, selective blending, and the open decisions.
Phase A of docs/CAMERA_BLEND_DESIGN.md: smooth the jump cuts when the exterior camera hands off between controllers (dynamic follow <-> scripted zone camera, and manual recenter). A single step at the camera commit point (before AffScene) watches the committed camera params; when they jump beyond a threshold it presents an interpolation from the previous frame's camera toward the new target over cam_blend_dur frames (RegleTrois for position/distance, shortest-arc for the angles), weight-blending toward the live target so a moving dynamic follow converges cleanly. Scene transitions (NumCube change, plus an 8-frame settle) and cutscenes (CinemaMode) are cut, not blended; classic camera and interiors are untouched. Divergence-triggered so it needs no changes to the controllers, at the cost of the heuristic rough edges noted in the design doc. cvars cam_blend (default on) and cam_blend_dur, persisted to cfg. Verified inert with no handoff (byte-stable against a no-blend capture within the scene noise floor).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prototype for smoothing the camera jump cuts, with the full design in
docs/CAMERA_BLEND_DESIGN.md.The problem
LBA2's exterior camera is driven by several controllers (dynamic follow,
scripted zone cameras that pull back for a scenic view, cutscenes, manual
recenter) that each grab the camera by hard-writing its globals. Every handoff
is an instant jump cut: entering a scenic zone cuts, leaving it cuts back, and
Center camera snaps.
Phase A (this PR)
A blend layer at the single camera commit point (before
AffScene) watches thecommitted camera params. When they jump beyond a threshold (a handoff), it
presents an interpolation from the previous frame's camera toward the new target
over
cam_blend_durframes:RegleTroisfor position and distance, shortest-arcfor the angles, weight-blended toward the live target so a moving dynamic follow
converges cleanly rather than aiming at a stale point.
integration point and no changes to the controllers.
NumCubechange, plus an 8-frame settle) and cutscenes(
CinemaMode) are cut, not blended. Classic camera and interiors untouched.cam_blend(default on) /cam_blend_durcvars, persisted to cfg.the scene's animation-noise floor); the blend feel needs interactive testing
(walk into a scenic camera zone).
Known rough edges (see the design doc)
This is a prototype. Divergence detection is a heuristic (a very fast legitimate
move could trip it; a tiny zone offset could miss it), the blend presents the
parametric camera without the per-frame occlusion lift (pops in at blend end),
and interpolation is linear (ease-in-out is a feel refinement). Instrumenting the
handoff sites directly and per-zone opt-out are the natural next steps.
Not in this PR
Phase B (a fully free dynamic camera: hold angle, re-center only on interior to
exterior + manual) and interior-to-exterior blending are separate, described in
the design doc.
How to test
Enable the Auto camera, walk into an area with a scripted scenic camera, and
watch the transition in and out.
cam_blend 0for the old jump cut;cam_blend_durto tune the length (frames).